<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>轮播图</title>
    <style>
        *{
            padding: 0;
            margin: 0;
            box-sizing: border-box;
        }
        img{
            width: 2000px;
            height: 1000px;
        }
        .box{
            width: 2000px;
            height: 1000px;
            /*border: 3px  red solid;*/
            margin: 200px auto;
            overflow: hidden;
            position: relative;
        }
        .list{
            list-style: none;
            display: flex;
            transition: left 1s ;
            position: absolute;
            left: 0;
        }
    </style>
    <script src="../jquery-3.6.3.min.js"></script>
    <script>
        $(function () {
            let index = 0
            let w = 2000
            let img = $(".list")
            let mi = $(".s")
            setInterval(function () {
                index++
                img.css("left",w*-1*index+'px')
                img.css("transition","left 1s")
                if (index===mi.length){
                    setTimeout(function () {
                        index=0
                        img.css("left",'0px')
                        img.css("transition","none")
                    },50)

                }
            },1000)
        })

    </script>
</head>
<body>
        <div class="box" id="box">
            <ul class="list">
                <li class="s"><img src="image/bz01.jpg" alt=""></li>
                <li class="s"><img src="image/bz02.jpg" alt=""></li>
                <li class="s"><img src="image/bz03.jpg" alt=""></li>
                <li class="s"><img src="image/bz04.jpg" alt=""></li>
                <li class="s"><img src="image/bz01.jpg" alt=""></li>
            </ul>
        </div>
</body>
</html>